﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace easyccms.BusinessLayer.Entities
{
    /// <summary>
    /// Menu entitiy definition .
    /// </summary>
    public class Menu : Entity
	{
        /// <summary>
        /// Gets or sets the menu id.
        /// </summary>
        /// <value>
        /// The menu id.
        /// </value>
       public virtual int MenuId { get; set; }

       /// <summary>
       /// Gets or sets the menu name.
       /// </summary>
       /// <value>
       /// The menu name.
       /// </value>
		[DisplayName("Menu Name")]
        [Required(ErrorMessage = "This has to be provided")]
        [StringLength(255, MinimumLength = 3)]
        public virtual string Name { get; set; }

        /// <summary>
        /// Gets or sets the menu order.
        /// </summary>
        /// <value>
        /// The menu order.
        /// </value>
        [DefaultValue(0)]
        public virtual int? MenuOrder { get; set; }

        /// <summary>
        /// Gets or sets the alt.
        /// </summary>
        /// <value>
        /// The alt.
        /// </value>
        [DisplayName("Alt link")]
        [Required(ErrorMessage = "Alt link has to be provided.")]
        [StringLength(255, MinimumLength = 5)]
        public virtual string Alt { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether [checked out].
        /// </summary>
        /// <value>
        ///   <c>true</c> if [checked out]; otherwise, <c>false</c>.
        /// </value>
        public virtual bool CheckedOut { get; set; }

        /// <summary>
        /// Gets or sets the checked out time.
        /// </summary>
        /// <value>
        /// The checked out time.
        /// </value>
        public virtual DateTime? CheckedOutTime { get; set; }

        /// <summary>
        /// Gets or sets the user group.
        /// </summary>
        /// <value>
        /// The user group.
        /// </value>
        [Required(ErrorMessage = "User group has to be provided.")]
        public virtual UserGroup UserGroup { get; set; }

        /// <summary>
        /// Gets or sets the name of the container.
        /// </summary>
        /// <value>
        /// The name of the container.
        /// </value>
        public virtual string ContainerName { get; set; }

        /// <summary>
        /// Gets or sets the created.
        /// </summary>
        /// <value>
        /// The created.
        /// </value>
        public virtual DateTime Created { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this <see cref="Menu"/> is deleted.
        /// </summary>
        /// <value>
        ///   <c>true</c> if deleted; otherwise, <c>false</c>.
        /// </value>
        public virtual bool Deleted { get; set; }

        /// <summary>
        /// Gets or sets the items.
        /// </summary>
        /// <value>
        /// The items.
        /// </value>
        public virtual IEnumerable<MenuItem> MenuItems { get; set; }

        /// <summary>
        /// Gets or sets the author.
        /// </summary>
        /// <value>
        /// The author.
        /// </value>
        public virtual SiteUser User { get; set; }
	}
}